{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 撰写19网3张海青"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 总结python  （关于python你知道什么？）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python语言的概述"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_feature = {\n",
    "    \"优缺点\":[\"优点.90\",\"缺点.85\"]         \n",
    "                 }"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python 的语法元素\n",
    "#### 命名：\n",
    "- 采用大写字母，小写字母，数字，下划线_ ,和汉字等字符及其组合命名\n",
    "- 名字的首字符不能是数字，中间不能出现空格\n",
    "- 标识对字符大小写比较敏感\n",
    "#### 常量：程序中值不发生改变的元素\n",
    "#### 变量：\n",
    "- 遵从命名规则\n",
    "- 值可以改变，通过命名，使用“=”赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_yufa = {\n",
    "    \"命名\":\"100\" ,\n",
    "    \"常量\":\"100\" ,\n",
    "    \"变量\":\"100\" ,\n",
    "    \n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python 基本输入输出函数\n",
    "#### input()函数 ：\n",
    "- 包含一些提示性文字，无论用户输入什么内容，其返回的函数均为字符串类型\n",
    "- <变量> = input(<提示性文字>)\n",
    "#### eval()函数\n",
    "- 能够以python的表达式的方式解析并执行字符串（转换成python语句并执行）\n",
    "- 处理字符串内容进行运算的结果可以用变量保存\n",
    "#### print（）函数，输出结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_churu = {\n",
    "    \"input()\" : \"100\" ,\n",
    "    \"eval()\" : \"90\" ,\n",
    "    \"print()\" : \"100\" ,\n",
    "    \"eval(input(<提示性文字>))\" : \"90\"\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python 程序的语句元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "pythom_yuju = {\n",
    "    \"表达式\" : \"90\",\n",
    "    \"引用\": [\"import<功能库名称> . 100\" ,\"<功能库名称>.<函数名称>() .100\"],\n",
    "    \"赋值语句\" : [\"变量=表达式 .100\" , \"多个变量赋值 . 100\"],\n",
    "    \"单分支语句if\":\"100\" ,\n",
    "    \"多分支语句if....elif....else\" :\"90\" ,\n",
    "    \"循环语句\" : {\n",
    "        \"遍历循环for i in range()\" : \"90\" ,\n",
    "        \"条件循环while\" : \"85\"\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python的基本数据类型---->数字类型\n",
    "#### 整数与数学中的整数概念一致，没有取值范围\n",
    "#### 浮点数与与数学中的实数概念一致，带有小数值，小数点后面可以是0  3.00"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_number = {\n",
    "    \"int\" : \"90\" ,\n",
    "    \"float\" : \"90\" \n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python的字符串类型及格式化\n",
    "#### 字符串(str)的内容可以分为单行字符串和多行字符串\n",
    "- 单行字符串可以由一对单引号('')或双引号(\"\")\n",
    "- 多行字符串可以由一对三单引号(''')或三双引号(\"\"\") \n",
    "#### format() :\n",
    "- <模板字符串>.format(<逗号分割的参数>)\n",
    "- 模板字符串是由一个字符串和槽组成的字符串“{} 1111111 ”\n",
    "- 槽用（{}）表示，模板字符串可以有多个槽，且槽内没有指定序号，则按照槽出现的顺序分别对应.format（）方法中的不同参数\n",
    "- 多个槽且有序号时，按序号来\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_zifuandgeshi = {\n",
    "    \"转义字符\" : [\"\\n/\\/'/\"/t . 95\"] ,\n",
    "    \"字符串\" : {\n",
    "        \"索引\" : [\"正向递增 . 100\" , \"反向递减 . 100\" ] ,\n",
    "        \"切片\" : \"100\"\n",
    "        \"操作\" : {\n",
    "            \"字符串操作符\" : \"95\" ,\n",
    "            \"字符串处理函数func(x)\" : \"90\" ,\n",
    "            \"字符串处理方法 <>.func(x)\" : \"85\"\n",
    "        }\n",
    "    } ,\n",
    "    \"format()\" : \"80\"\n",
    "    \n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### python 类型判断和类型间转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_xx = {\n",
    "    \"type(x)\" : \"95\" ,\n",
    "    \"类型间转换函数\" : [\"int(x).95\" , \"float(x).95\",\"str(x).95\"]\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "### python 的组合数据类型\n",
    "#### tuple:\n",
    "- 一旦创建不能修改\n",
    "- 元组类型可以不同\n",
    "\n",
    "#### tuple:\n",
    "- 一旦创建不能修改\n",
    "- 元组类型可以不同\n",
    "\n",
    "#### dict :\n",
    "- 字典是第一种可变容器模型，且可存储任意类型对象。\n",
    "- 字典的key（键），value（值）合称键值key=>value对用冒号：隔开个键值用逗号,隔开\n",
    "- 整个字典用大括号{}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "python_zuheshuju = {\n",
    "    \"tuple\" : {\n",
    "        \"元组的定义\" :\"95\" ,\n",
    "        \"创建tuple\" :[\"用（）创建tuple . 100\" ,\"元组中嵌套元组 . 85\" ,\"把序列转换为元组range .85\" ,\"把字符串转换为元组 . 95\"] ,\n",
    "        \"tuple的索引\" : \"95\" ,\n",
    "        \"tuple的切片\" : \"95\" ,\n",
    "        \"tuple的操作符\" : \"95\",\n",
    "        \"list的处理函数func（X）\" : \"95\",\n",
    "        \"list处理方法 <>.func(x)\" : \"85\"\n",
    "    } ,\n",
    "    \"list\" : {\n",
    "        \"list的定义\" : \"85\",\n",
    "        \"list的创建\" : \"85\",\n",
    "        \"list的索引\" : [\"反向递增.80\" , \"正向递增 .80\"] ,\n",
    "        \"list的切片\" : [\"[N:M] .75\" ,\"[N:M:K] . 75\"] ,\n",
    "        \"list的操作\" : {\n",
    "            \"list的操作符\" : \"75\",\n",
    "            \"list的处理函数func（X）\" : \"75\",\n",
    "            \"其他操作方法(处理方法)：<列表变量>.<方法名称>(<方法参数>)\" :[\"向列表添加元素 .90\",\"从列表中删除元素 .90\" ,\n",
    "                                             \"s.copy()和赋值s=t .80\" , \"s.reverse . 80\" ,\"其他如s.index() . 85\" ]\n",
    "        }\n",
    "    } ,\n",
    "   \n",
    "    \"dict\" : {\n",
    "        \"dict的定义\" : \"95\" ,\n",
    "        \"dict创建方式\" : \"90\" ,\n",
    "        \"dict键的特性\" : \"95\" ,\n",
    "        \"dict的查询\" : \"80\" ,\n",
    "        \"dict的取值\" : \"80\" ,\n",
    "        \"访问dict里的值\" : \"95\" ,\n",
    "        \"dict的索引<值> = <字典变量>[<键>]\" : \"80\" ,\n",
    "        \"dict的赋值 = \" : \"95\" ,\n",
    "        \"dict的操作\" : {\n",
    "            \"dict的处理函数func（X）\" : \"80\" ,\n",
    "            \"dict的操作函数（处理方法）\" :\"80\" ,\n",
    "            \"for循环对dict进行遍历循环for<变量名> in <字典名>\" : \"85\"\n",
    "            \n",
    "        }\n",
    "        \n",
    "    } ,\n",
    "    \"set\" : {\n",
    "        \"set的定义\" : \"90\" ,\n",
    "        \"set的操作\" :{\n",
    "            \"set的操作符\" : \"85\" ，\n",
    "            \"list的处理函数func（X）\" : \"80\" ,\n",
    "            \"dict的操作函数（处理方法）\" : \"80\"\n",
    "        }\n",
    "        \n",
    "    }\n",
    "    \n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "### python的函数\n",
    "- 作用：1.节省代码  \n",
    "        2.小白可以使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "func = {\n",
    "    \"基本使用\" : {\n",
    "        \"func的调用\" : [\"def<函数列表>(<参数列表>-->（<函数体>)--> return<返回值列表> .100\" ,\n",
    "                     \"函数名定义 .100\" ,\"参数列表定义 .100\" , \"形参定义 . 100\" ,\"实参定义 .100\" ，\n",
    "                     \"函数体的定义 .95\" ,\"return的定义 .100\" ,\"调用方法 .95\"]\n",
    "    } ,\n",
    "    \"参数传递\" : {\n",
    "        \"可选参数传递(没有传入函数定义时，默认参数值)\" : \"90\" \n",
    "        \"参数的位置\" : [\"位置参数 .90\" ,\"关键字参数 .90\" ,\"位置参数和关键字参数可以混合使用 .85\"] ,\n",
    "        \"参数的名称传递\" : \"85\" ,\n",
    "        \"函数的返回值\" : \"85\" ,\n",
    "    } ,\n",
    "    \"导入整个模块\" : {\n",
    "         \"模块中导入函数\" :[\"from .85\" ,\"import函数名称 .80\"] ,\n",
    "         \"as的用法\" : \"85\"\n",
    "    } ,\n",
    "    \"变量的作用邻域\" :{\n",
    "        \"局部变量\" : \"80\" ,\n",
    "        \"全局变量\" : \"80\" ,\n",
    "    },\n",
    "    \"模块中导入函数\" :[\"from .85\" ,\"import函数名称 .75\"] ,\n",
    "    \"函数的递归\" ：[\"定义 .80\" ,\"if....else .70\" ,\"字符串反转 .50\" ]\n",
    "}"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
